home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 16 / PC Actual CD 16.iso / autocad / R14701.DXR / 00002_aboutScript.ls < prev    next >
Encoding:
Text File  |  1997-04-24  |  4.5 KB  |  101 lines

  1. property pPictureSprite, pTextDisplaySprite, pSectButtonSpriteList, pSectButtonFirstMemNum, pButtonObjectList, pScrollBarObj, pThumbSprite, pDisplayTextList
  2. global gScript, gVoid
  3.  
  4. on initAboutScreen
  5.   set gScript to script "aboutScript"
  6.   set the pPictureSprite of gScript to 3
  7.   set the pTextDisplaySprite of gScript to 4
  8.   set the visible of sprite the pPictureSprite of gScript to 0
  9.   go("about")
  10.   puppetAllSprites(1)
  11.   initText()
  12.   initControls()
  13. end
  14.  
  15. on closeAboutScreen
  16.   puppetAllSprites(0)
  17.   put " " into field "textDisplay"
  18.   if not objectp(gScript) then
  19.     exit
  20.   end if
  21.   cleanUpBeforeLeaving()
  22.   repeat with i = 1 to count(gScript)
  23.     setaProp(gScript, getPropAt(gScript, i), gVoid)
  24.   end repeat
  25.   set gScript to gVoid
  26. end
  27.  
  28. on initControls
  29.   set the pButtonObjectList of gScript to [:]
  30.   set the pSectButtonSpriteList of gScript to [10, 11, 12]
  31.   set the pSectButtonFirstMemNum of gScript to the number of member "top01"
  32.   set tDisplayPropsOne to [#member: member "g7107", #text: #profile]
  33.   set tDisplayPropsTwo to [#member: member "g7201", #text: #cust]
  34.   set tDisplayPropsTre to [#member: member "g7301", #text: #globe]
  35.   set tCommandList to ["displayInfo(" & tDisplayPropsOne & ")", "displayInfo(" & tDisplayPropsTwo & ")", "displayInfo(" & tDisplayPropsTre & ")"]
  36.   repeat with i = 1 to count(the pSectButtonSpriteList of gScript)
  37.     set currSpriteNum to getAt(the pSectButtonSpriteList of gScript, i)
  38.     addProp(the pButtonObjectList of gScript, currSpriteNum, birth(script "sectButton Parent Script", currSpriteNum, the pSectButtonFirstMemNum of gScript + ((i * 3) - 3), i, getAt(tCommandList, i)))
  39.   end repeat
  40.   set tBar to 6
  41.   set tTop to 7
  42.   set tBot to 8
  43.   set tThm to 9
  44.   set the pThumbSprite of gScript to tThm
  45.   set tStdButtonList to [[#sprite: tBar, #firstMember: the number of member "scrbar01", #command: "mClickScrollBar(the pScrollBarObj of gScript)", #repeat: 1, #down: 1, #delay: 15], [#sprite: tTop, #firstMember: the number of member "scrtop01", #command: "mClickUpArrow(the pScrollBarObj of gScript)", #repeat: 1, #down: 1, #delay: 15], [#sprite: tBot, #firstMember: the number of member "scrbot01", #command: "mClickDownArrow(the pScrollBarObj of gScript)", #repeat: 1, #down: 1, #delay: 15], [#sprite: tThm, #firstMember: the number of member "scrthm01", #command: "mClickBoxButton(the pScrollBarObj of gScript)", #repeat: 1, #down: 1, #forceRoll: 1]]
  46.   repeat with tCurrButtonProps in tStdButtonList
  47.     addProp(the pButtonObjectList of gScript, the sprite of tCurrButtonProps, new(script "stdButtonClass", tCurrButtonProps))
  48.   end repeat
  49.   updateStage()
  50.   set the pScrollBarObj of gScript to new(script "ScrollBarClass", [#pTopArrowSprite: tTop, #pBotArrowSprite: tBot, #pBoxButtonSprite: tThm, #pScrollBarSprite: tBar, #pFieldMember: member "textDisplay"])
  51.   mClickOnButton(getaProp(the pButtonObjectList of gScript, 10), "Mouse Down", 1)
  52. end
  53.  
  54. on initText
  55.   set tFileList to [#profile: "profile.txt", #cust: "cust.txt", #globe: "globe.txt"]
  56.   set the pDisplayTextList of gScript to [:]
  57.   if not doesXtraExist("fileio") then
  58.     alert("The FileIO Xtra is not in the Xtras directory.")
  59.     exit
  60.   end if
  61.   set tFileIO to new(xtra("fileio"))
  62.   if not objectp(tFileIO) then
  63.     alert("Problem using FileIO Xtra, check to make sure it's there ...")
  64.     exit
  65.   end if
  66.   repeat with i = 1 to count(tFileList)
  67.     set tFileName to the pathName & getAt(tFileList, i)
  68.     openFile(tFileIO, tFileName, 1)
  69.     set tString to readFile(tFileIO)
  70.     set tStatus to status(tFileIO)
  71.     closeFile(tFileIO)
  72.     set tCurrProp to getPropAt(tFileList, i)
  73.     if tStatus <> 0 then
  74.       addProp(the pDisplayTextList of gScript, tCurrProp, "Couldn't load text file: " & tFileName)
  75.       next repeat
  76.     end if
  77.     set tString to removeLFCharFromText(tString)
  78.     addProp(the pDisplayTextList of gScript, tCurrProp, tString)
  79.   end repeat
  80.   set tFileIO to 0
  81. end
  82.  
  83. on cleanUpBeforeLeaving
  84.   if listp(the pButtonObjectList of gScript) then
  85.     repeat with i = 1 to count(the pButtonObjectList of gScript)
  86.       set tActPos to getPos(the actorList, getAt(the pButtonObjectList of gScript, i))
  87.       if tActPos > 0 then
  88.         deleteAt(the actorList, tActPos)
  89.       end if
  90.     end repeat
  91.   end if
  92.   set the pButtonObjectList of gScript to [:]
  93. end
  94.  
  95. on displayInfo myProps
  96.   set the member of sprite the pPictureSprite of gScript to the member of myProps
  97.   set the visible of sprite the pPictureSprite of gScript to 1
  98.   put getaProp(the pDisplayTextList of gScript, the text of myProps) into field "textDisplay"
  99.   reset(the pScrollBarObj of gScript)
  100. end
  101.